home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1998 July / EnigmA AMIGA RUN 29 (1998)(G.R. Edizioni)(IT)[!][issue 1998-07 & 08].iso / earkit / browser / awebdecoders / awebpng / awebpng.awebrx < prev    next >
Text File  |  1998-05-24  |  6KB  |  156 lines

  1. /* awebpng.awebrx - Install or uninstall the AWeb PNG plugin */
  2.  
  3. options results
  4.  
  5. if left(address(),5)~="AWEB." then do
  6.    ports=show("P")
  7.    parse var ports dummy "AWEB." portnr .
  8.    if portnr="" then do
  9.       address command "run AWeb3:AWeb-II"
  10.       address command "WaitForPort AWEB.1"
  11.       portnr=1
  12.    end
  13.    address value "AWEB."portnr
  14.    'get activeport'
  15.    address value result
  16. end
  17.  
  18. parse arg args
  19. parse source dummy1 dummy2 called .
  20. i=lastpos(called,'/')
  21. if i==0 then i=lastpos(called,':')
  22. if i>0 then path=left(called,i)
  23. else path=''
  24.  
  25. if args='' then do
  26.    if ~open(tf,"T:awebpngsetup.html","W") then exit
  27.  
  28.    call writeln tf,"<html><head><title>AWeb PNG Setup</title></head>"
  29.    call writeln tf,"<body><h1>AWeb PNG Setup</h1>"
  30.    
  31.    if exists("AWebPath:awebplugin/awebpng.awebplugin") then do
  32.       installed=0
  33.       progress=4
  34.       gamma=2.0
  35.       lowpri=0
  36.       'getcfg MIME stem m'
  37.       do i=1 to m.0
  38.          if upper(left(m.i.value,10))="IMAGE/PNG;" | upper(left(m.i.value,12))="IMAGE/X-PNG" then do
  39.             parse var m.i.value type ";" ext ";" action ";" file ";" args
  40.             if action='A' & upper(right(file,18))="AWEBPNG.AWEBPLUGIN" then do
  41.                installed=1
  42.                j=index(upper(args),"PROGRESS=")
  43.                if j>0 then do
  44.                   progress=substr(args,j+9)
  45.                   j=verify(progress,"0123456789")
  46.                   if j>0 then progress=left(progress,j-1)
  47.                end
  48.                j=index(upper(args),"GAMMA=")
  49.                if j>0 then do
  50.                   gamma=substr(args,j+6)
  51.                   j=verify(gamma,"0123456789.")
  52.                   if j>0 then gamma=left(gamma,j-1)
  53.                end
  54.                lowpri=(index(upper(args),"LOWPRI")>0)
  55.             end
  56.             leave
  57.          end
  58.       end
  59.       
  60.       call writeln tf,"<table border width=100% bgcolor=#aaccaa><tr><td>"
  61.       call writeln tf,"<form action='x-aweb:rexx/"called"'>"
  62.       call writeln tf,"This form configures AWeb-II to use the <strong> AWeb PNG plugin</strong>."
  63.       call writeln tf,"<input type=hidden name=defprogress value="progress">"
  64.       call writeln tf,"<ol><li>Select the required modes of operation "
  65.       call writeln tf,"(see <a href='file:///AWebPath:awebplugin/docs/awebpng.html#parameters'>documentation</a> for details)"
  66.       call writeln tf,"<p><ul><li>Progressive display:<br>"
  67.       call writeln tf,"<input type=radio name=progress value=0"
  68.       if progress=0 then call writeln tf," checked"
  69.       call writeln tf,"> No progressive display (fastest)<br>"
  70.       call writeln tf,"<input type=radio name=progress value=4"
  71.       if progress=4 then call writeln tf," checked"
  72.       call writeln tf,"> Standard progressive display<br>"
  73.       call writeln tf,"<input type=radio name=progress value=1"
  74.       if progress=1 then call writeln tf," checked"
  75.       call writeln tf,"> Smooth progressive display (slowest)<br>"
  76.       call writeln tf,"<p><li>Gamma (colour correction factor):<br>"
  77.       call writeln tf,"<input type=text name=gamma value='"gamma"'> (Default value 2.0)<br>"
  78.       call writeln tf,"<p><li>Multitasking:<br>"
  79.       call writeln tf,"<input type=checkbox name=lowpri value='LOWPRI'"
  80.       if lowpri then call writeln tf," checked"
  81.       call writeln tf,"> Run decoder at low priority<br>"
  82.       call writeln tf,"</ul>"
  83.       call writeln tf,"<p><li><input type=checkbox name=save value=yes checked> Save the new settings"
  84.       call writeln tf,"<p><li><input type=submit value='Install AWeb PNG plugin'>"
  85.       call writeln tf,"</ol></form></table>"
  86.  
  87.       if installed>0 then do
  88.          call writeln tf,"<p><table border width=100% bgcolor=#ccaaaa><tr><td>"
  89.          call writeln tf,"<form action='x-aweb:rexx/"called"'>"
  90.          call writeln tf,"<input type=hidden name=deinstall value=''>"
  91.          call writeln tf,"This form will deinstall the AWeb PNG plugin and reset the default (datatypes) decoder for PNG images."
  92.          call writeln tf,"<ol><li><input type=checkbox name=save value=yes checked> Save the new settings"
  93.          call writeln tf,"<p><li><input type=submit value='De-install AWeb PNG plugin'>"
  94.          call writeln tf,"</ol></form></table>"
  95.       end
  96.  
  97.    end
  98.    else do
  99.       call writeln tf,"Plugin file not found. You have to run the install script first."
  100.    end
  101.    
  102.    call writeln tf,"<p><hr><p><a href='file:///AWebPath:awebplugin/docs/awebpng.html'>Back to documentation</a>"
  103.    
  104.    call close tf
  105.    'open "file:///T:awebpngsetup.html" reload'
  106.    'wait "file:///T:awebpngsetup.html"'
  107.    'allowcmd'
  108.    address command 'delete T:awebpngsetup.html quiet'
  109.  
  110. end
  111. else do
  112.    
  113.    type="IMAGE/PNG"
  114.    ext="png"
  115.    rest=";"
  116.    
  117.    'getcfg MIME stem m'
  118.    do i=1 to m.0
  119.       if upper(left(m.i.value,10))="IMAGE/PNG;" | upper(left(m.i.value,12))="IMAGE/X-PNG" then do
  120.          parse var m.i.value type ";" ext ";" action ";" rest
  121.          leave
  122.       end
  123.    end
  124.  
  125.    if upper(left(args,9))="DEINSTALL" then do
  126.       mime=type";"ext";;"rest
  127.    end
  128.    else do
  129.       progress=""
  130.       defprogress="4"
  131.       gamma="2.0"
  132.       lowpri=""
  133.       save=""
  134.       
  135.       do while args~=""
  136.          parse var args nextarg args
  137.          interpret nextarg
  138.       end
  139.       
  140.       if progress="" then progress=defprogress
  141.       mime=type";"ext";A;AWebPath:awebplugin/awebpng.awebplugin;PROGRESS="progress" GAMMA="gamma lowpri
  142.    end
  143.    
  144.    'setcfg MIME "'mime'" ADD'
  145.  
  146.    if upper(save)="YES" then do
  147.       'savesettings'
  148.    end
  149.  
  150.    'open "file:///AWebPath:awebplugin/docs/awebpng.html"'
  151.  
  152. end
  153.  
  154. exit
  155.  
  156.